cmake_minimum_required(VERSION 3.22)   
project(fileserver)  
#aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} SRC_LISTS) 
set(SRC_LISTS ${SRC_LISTS} ${CMAKE_CURRENT_SOURCE_DIR}/fileserver.cpp) 
set(SRC_LISTS0 ${SRC_LISTS0} ${CMAKE_CURRENT_SOURCE_DIR}/tcpputfiles.cpp) 
set(SRC_LISTS1 ${SRC_LISTS1} ${CMAKE_CURRENT_SOURCE_DIR}/tcpgetfiles.cpp) 
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/output) 
add_executable(fileserver ${SRC_LISTS})
add_executable(tcpputfiles ${SRC_LISTS0}) 
add_executable(tcpgetfiles ${SRC_LISTS1}) 

#增加头文件，库文件
target_include_directories(fileserver PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR}/../../public)
target_link_directories(fileserver PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR}/../../public)
target_link_libraries(fileserver PUBLIC _public)

target_include_directories(tcpputfiles PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR}/../../public)
target_link_directories(tcpputfiles PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR}/../../public)
target_link_libraries(tcpputfiles PUBLIC _public)

target_include_directories(tcpgetfiles PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR}/../../public)
target_link_directories(tcpgetfiles PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR}/../../public)
target_link_libraries(tcpgetfiles PUBLIC _public)


# 显式指定编译器
set(CMAKE_CXX_COMPILER "g++")                                                                   #设置编译器


# 开启调试信息
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")

# 开启所有警告
set(CMAKE_CXX_FLAGS "-Wall")